<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">

                <div class="ibox-title">
                    <h5>{$page_title}</h5>
                    <div class="ibox-tools"><a href="javascript:void(0);" class="btn btn-xs btn-default btn-help-detail"  data-type="cst_clue"> <i class="fa fa-question-circle"> {:lang('help')}</i></a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form id="pagerForm" method="post" class="form-inline searchForm">
                            <div class="col-sm-12">
                                <div class="input-group">
                                    <input type="text" name="keywords" placeholder="{:lang('输入关键字搜索')}" class="form-control">
                                </div>
                                <div class="input-group">
                                  <span class="input-group-btn">
                                  <button type="button" class="btn btn-primary ajaxSearchForm"><i class="fa fa-search"></i> {:lang('搜索')}</button>
                                  </span>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-10">
                            <lqf_link>
                                <a class="btn btn-info ajax-open"  data-url="{:url('TenUser/add')}" >
                                    <i class="fa fa-plus"></i> {:lang('添加')}
                                </a>
                            </lqf_link>
                            <lqf_link>
                                <a class="btn btn-info ajax-open-more"  data-url="{:url('TenUser/resetPwd')}" width="800" height="400" >
                                    <i class="fa fa-plus"></i> {:lang('重置密码')}
                                </a>
                            </lqf_link>
                        </div>
                    </div>
                </div>
                <div class="ibox-content table-responsive">
                    <table class="table table-hover sorttable ajax-list-table" data-url="{:url('TenUser/show_json')}" width="100%">
                        <thead>
                        <tr>
                            <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                            <th width="40">{:lang('ID')}</th>
                            <th width="80">{:lang('账号')}</th>
                            <th width="100">{:lang('名称')}</th>
                            <th width="80">{:lang('手机')}</th>
                            <th width="100">{:lang('邮箱')}</th>
                            <th width="150">{:lang('创建企业')}</th>
                            <th width="100">{:lang('所属企业')}</th>
                            <th width="100">{:lang('默认加载')}</th>
                            <th width="60" class="text-center">{:lang('关联租户')}</th>
                            <th width="80"  class="text-center">{:lang('启用')}</th>
                            <th width="120" class="text-center">{:lang('创建时间')}</th>
                            <th width="150" class="text-center">{:lang('操作')}</th>
                        </tr>
                        </thead>
                        <tbody>
                        </tbody>
                        <tfoot class="ibox-content">
                        <tr>
                            <td colspan="13" align="center"></td>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script id="tableListTpl" type="text/html">
    <% for(var i=0;i<data.length;i++) {
    var visible='';if(data[i]['visible']=='1') visible='checked';
    %>
    <tr>
        <td><input name="user_id" class="checkboxCtrlId" value="<%=data[i]['id']%>" type="checkbox"></td>
        <td><%=data[i]['id']%></td>
        <td>
            <a class="ajax-open" data-url="{:url('TenUser/detail')}"  data-ids="{'id':'<%=data[i]['id']%>'}">
            <%=data[i]['username']%>
            </a>
        </td>
        <td><%=data[i]['realname']%></td>
        <td><%=data[i]['mobile']%></td>
        <td><%=data[i]['email']%></td>
        <td><%=data[i]['create_company_name']%></td>

        <td>
            <a class="ajax-open" data-url="{:url('TenTenant/detail')}"  data-ids="{'id':'<%=data[i]['ten_tenant_id']%>'}" >
                <%=null2empty(data[i]['owner_company_name'])%>
            </a>
        </td>
        <td>
            <a class="ajax-open" data-url="{:url('TenTenant/detail')}"  data-ids="{'id':'<%=data[i]['init_tenant_id']%>'}" >
            <%=null2empty(data[i]['init_company_name'])%>
            </a>
        </td>
        <td class="text-center">
            <a class="ajax-open" data-url="{:url('TenUser/detail')}"  data-ids="{'id':'<%=data[i]['id']%>'}">
                ( <%=data[i]['tenant_nums']%> )
            </a>
        </td>
        <td class="text-center">
            <input name="visible" class="ajax-checkbox" type="checkbox"
                   data-url="{:url('TenUser/set_visible',array('name'=>'visible'))}"
                   data-id="<%=data[i]['id']%>" <%=visible%> >
        </td>
        <td class="text-center"><%=data[i]['create_time']%></td>
        <td class="text-center">
            <lqf_link>
                <a class="ajax-open" data-url="{:url('TenUser/createTenant')}"  data-ids="{'id':'<%=data[i]['id']%>'}" data-title="{:lang('initialize system users')}">
                <i class="fa fa-user-plus"></i>{:lang('创建租户')}</a>
            </lqf_link>
            <lqf_link><a class="ajax-open" data-url="{:url('TenUser/edit')}"  data-ids="{'id':'<%=data[i]['id']%>'}" >{:lang('修改')}</a></lqf_link>
            <lqf_link><a class="ajax-del confirm" data-url="{:url('TenUser/del')}" data-ids="{'id':'<%=data[i]['id']%>'}">{:lang('删除')}</a></lqf_link>
        </td>
    </tr>
    <% } %>
</script>
<script type="text/javascript">
    $(document).ready(function () {
        turnPage(1);
    });
</script>